package com.zengqingfa.designpattern.structure.decorator;

/**
 * @author zengqingfa
 * @className Client
 * @description
 * @create 2021/8/29 23:15
 */
public class Client {

    public static void main(String[] args) {
        /**
         * 拍照
         * ====================
         * 美颜
         * 拍照
         * ====================
         * 滤镜
         * 美颜
         * 拍照
         */
        Component component=new ConcreComponent();
        component.operate();
        System.out.println("====================");
        //装饰A功能
        Component a=new ConcreteDecoratorA(component);
        a.operate();
        System.out.println("====================");
        //装饰A、B功能
        Component ab=new ConcreteDecoratorB(new ConcreteDecoratorA(component));
        ab.operate();
    }
}